package com.pinda.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pinda.auth.entity.AuthUserAndCoreOrg;
import com.pinda.auth.entity.PdAuthUser;
import com.pinda.commonutils.Page;
import com.pinda.commonutils.Result;
import com.pinda.commonutils.StatusCode;
import com.pinda.oms.entity.PdOrderAndTransport;
import com.pinda.service.IPdAuthUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 黄杰
 * @since 2023-06-13
 */
@RestController
@RequestMapping("/pd-auth-user")
public class PdAuthUserController {

    @Resource
    private IPdAuthUserService pdAuthUserService;

    @PostMapping("findAuthUserAndCoreOrg")
    public PageInfo<AuthUserAndCoreOrg> findAuthUserAndCoreOrg(@RequestBody Page<AuthUserAndCoreOrg>  page){
        PageHelper.startPage(page.getPageNum(),page.getPageSize());
        PageInfo<AuthUserAndCoreOrg> pageInfo=new PageInfo(pdAuthUserService.findAuthUserAndCoreOrg(page.getSearch()));
        System.out.println(pageInfo);
        return pageInfo;
    }
    @PostMapping("querycourierid")
    public List<PdAuthUser> querycourierid(){
        QueryWrapper<PdAuthUser> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("station_id",3);
        List<PdAuthUser> list = pdAuthUserService.list(queryWrapper);
        return list;
    }
}
